import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token' // 存储token

const timekey = 'hrsass-timestamp-key' // 存储token到时间戳

// 从cookies中获取token存储的时间戳
export function getTimestamp() {
  return Cookies.get(timekey)
}
// 存储获取到token时的时间戳
export function setTimestamp() {
  return Cookies.set(timekey, Date.now())
}

// 从cookie中获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 存储token到cookie中
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 将token从cookie中删除
export function removeToken() {
  return Cookies.remove(TokenKey)
}
